$(function() {


		$('#dg').datagrid({
			"rownumbers":true,
			 "url":"sys/test/query",
//				"fitColumns":true,
//				"fit":true,
			"pagination":true,
			width: ($(window).width()*0.99), 
			height:($(window).height()*0.98),
			"columns":[[
				          {field:'username',title:'用户名',width:100,align:'right'},
			          {field:'name',title:'姓名',width:100,align:'right'},
			          {field:'enabled',title:'可用',width:100,align:'right',formatter: function(value,row,index){
							if (value){
								return "可用";
							} else {
								return "不可用";
							}
						}
			          },
			          {field:'username',title:'用户名',width:100,align:'right'},
			          {field:'username',title:'用户名',width:100,align:'right'},
			          {field:'username',title:'用户名',width:100,align:'right'},
			          {field:'username',title:'用户名',width:100,align:'right'},
			          {field:'username',title:'用户名',width:100,align:'right'},
			          {field:'username',title:'用户名',width:100,align:'right'},

			      ]]
					
			
					
					
		}).datagrid('getPager').pagination({
            layout:['list','sep','first','prev','sep','links','sep','next','last','sep','refresh','sep','manual'],
            beforePageText:'Go Page',
            afterPageText:''
        });;

        $(window).resize(function() {
        	$('#dg').datagrid({
    			width: ($(window).width()*0.9), 
    			height:($(window).height()*0.9),
        	});
        });
	

});